﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

using Ice.Toolkit.Data.Entity;

namespace Ice.Toolkit.Data
{
    public interface IQuery<T> where T: EntityBase<T>,new()
    {
        IQuery<T> Where(Expression<Func<T, Boolean>> expression);
        IQuery<T> Take(Int32 count);
        IQuery<T> OrderBy<TKey>(Expression<Func<T, TKey>> expression);
        IQuery<T> OrderByDescending<TKey>(Expression<Func<T, TKey>> expression);

        T Single();
        List<T> ToList();
        Int32 Count();
    }
}
